package com.cloud.drore.eboss.sso.service.impl;

import com.cloud.drore.eboss.sso.dao.RoleRightRelationDao;
import com.cloud.drore.eboss.sso.entity.EbossRoleRightRelation;
import com.cloud.drore.eboss.sso.service.RoleRightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional
public class RoleRightServiceImpl extends EntityServiceImpl<EbossRoleRightRelation, Long, RoleRightRelationDao> implements RoleRightService {

	@Override
	public void save(List<EbossRoleRightRelation> roleRightRelations){
		this.entityDao.save(roleRightRelations);
	}

	@Override
	public void deleteByuserId(Long id) {
		this.entityDao.deleteByRoleId(id);
	}

	@Override
	public List<EbossRoleRightRelation> findByRoleId(Long roleId) {
		return this.entityDao.findByRoleId(roleId);
	}

	@Autowired
	public void setEntityDao(RoleRightRelationDao entityDao) {
		this.entityDao = entityDao;
	}
}